package local.blueheart.data.springdatademo.util;

import org.fit.cssbox.demo.ImageRenderer;
import org.xml.sax.SAXException;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;

public class HtmlToImageHelper {

    public static void urlToImage(String url,String saveFilePath) throws IOException, SAXException {
        ImageRenderer imageRenderer = new ImageRenderer();
        FileOutputStream fos = new FileOutputStream(new File(saveFilePath));
        imageRenderer.renderURL(url,fos,ImageRenderer.Type.PNG);
    }

    public static void main(String[] args){

    }

}
